﻿<html debug="true" xmlns="http://www.w3.org/1999/xhtml"><!-- debug -->
	<head>
		<title>repeat-min, repeat-max, and repeat-start attributes</title>
		<meta name="description" content="" />
		<meta name="keywords" content="repetition" />
		<script type="text/javascript" src="../../webforms2_src.js"></script>
		<script type="text/javascript" src="firebug/firebug.js"></script>
		
		<!-- BEGIN HEAD -->
		<script type="text/javascript">
		var count = 0;
		var doStrip = true;
		function addEventLogEntry(evt){
			document.getElementById('doNote').style.display='none';
		
			count++;
			var tbody = document.getElementById('eventLog');
			var row = document.createElement('tr');
			var cell;
			
			cell = document.createElement('th');
			cell.appendChild(document.createTextNode(evt.element.repetitionIndex));
			row.appendChild(cell);
			
			cell = document.createElement('td');
			cell.appendChild(document.createTextNode(evt.type));
			cell.className = 'type';
			row.appendChild(cell);
			
			cell = document.createElement('td');
			cell.appendChild(document.createTextNode(evt.element.repetitionTemplate.repetitionBlocks.length));
			row.appendChild(cell);
			
			tbody.insertBefore(row, tbody.firstChild);
		}
		</script>
		<!-- END HEAD -->
	</head>
	<body>
		<div id="testcaseDesc">
			<p>The following verifies that the <code>repeat-min</code>, <code>repeat-max</code>, and <code>repeat-start</code> attributes work correctly.
			The event log utilizes the <code>onadd</code> and <code>onremove</code> extensions to the repetition model specification.</p>
		</div>
		
		<!-- BEGIN TEST CASE -->

		<p>For the following repetition template:</p>
		<ul>
			<li><code>repeat-min</code> = 1</li>
			<li><code>repeat-max</code> = 5</li>
			<li><code>repeat-start</code> = 3</li>
		</ul>

		<div>
			<div id="i" repeat="template" repeat-start="3" repeat-min="1" repeat-max="5" onadded="addEventLogEntry(event)" onremoved="addEventLogEntry(event)">
				#<input type="text" value="[i]" /><button type="remove">Remove</button>
			</div>
		</div>
		<p><button type="add" template="i">Add block</button></p>
				
		<fieldset id="eventLogBox">
			<legend><strong>Event Log</strong></legend>
			<table cellspacing="0" cellpadding="5">
				<thead>
					<tr>
						<th>#</th>
						<th>Type</th>
						<th><code>repetitionBlocks.length</code></th>
					</tr>
				</thead>
				<tbody id="eventLog"></tbody>
			</table>
			<div id="doNote"><em>(Click the <code>add</code> button above to fire events)</em></div>
		</fieldset>
	
		<!-- END TEST CASE -->
		
	</body>
</html>
